package com.atguigu.gulimall.product.service;

import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.product.entity.SpuInfoEntity;
import com.atguigu.gulimall.product.entity.vo.SpuSaveVo;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

/**
 * spu信息
 *
 * @author huguangwei
 * @email huguangwei@gmail.com
 * @date 2022-10-07 20:12:13
 */
public interface SpuInfoService extends IService<SpuInfoEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 发布商品保存
     *
     * @param vo
     */
    @Transactional
    void saveSpuInfo(SpuSaveVo vo);

    @Transactional
    void saveBaseSpuInfo(SpuInfoEntity infoEntity);

    /**
     * 根据条件查询spu信息
     *
     * @param params
     * @return
     */
    PageUtils queryPageCondition(Map<String, Object> params);

    /**
     * 商品上架
     *
     * @param spuId
     */
    void up(Long spuId);

    SpuInfoEntity getSpuInfoBySkuId(Long skuId);
}

